﻿<Window x:Class="Boggle.Client.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:b="clr-namespace:Boggle.Client;assembly=Bogglex"
        Title="Bogglex" Height="500" Width="700" MinHeight="500" MinWidth="700"
        Name="wnd" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True"
        Background="Transparent" FontFamily="Calibri">
    <Border Name="border" Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Silver">
        <Border.Effect>
            <DropShadowEffect Color="Black" Direction="270" BlurRadius="10" ShadowDepth="3" />
        </Border.Effect>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="5" />
                <ColumnDefinition />
                <ColumnDefinition Width="5" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="5" />
                <RowDefinition />
                <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <DockPanel Background="{StaticResource DefaultBackgroundBrush}" Grid.ColumnSpan="3" Grid.RowSpan="3">
                <DockPanel Typography.Capitals="AllSmallCaps" DockPanel.Dock="Top" Background="{StaticResource WindowMainBrush}">
                    <DockPanel DockPanel.Dock="Top">
                        <Button Margin="4,4,12,4" HorizontalAlignment="Right" DockPanel.Dock="Right" Style="{StaticResource menuItemStyle}" Content="x" Command="Close" />
                        <Button Margin="4" HorizontalAlignment="Right" DockPanel.Dock="Right"  Style="{StaticResource menuItemStyle}" Content="_" Command="b:BoggleCommands.MinimizeWindowCommand" />
                        <TextBlock Name="titleBar" HorizontalAlignment="Stretch" Padding="4" Text="{Binding ElementName=wnd, Path=Title}" Foreground="{StaticResource WindowMainTextBrush}" FontSize="14" FontWeight="999" />
                    </DockPanel>
                    <StackPanel DockPanel.Dock="Left" Orientation="Horizontal">
                        <Button Style="{StaticResource menuItemStyle}" Content="Start Game" Command="b:BoggleCommands.StartGameCommand" />
                        <Button Style="{StaticResource menuItemStyle}" Content="End Game" Command="b:BoggleCommands.EndGameCommand" />
                        <Button Style="{StaticResource menuItemStyle}" Content="Options" Command="b:BoggleCommands.ViewOptionsCommand" />
                    </StackPanel>
                </DockPanel>
                <Grid Typography.Capitals="AllSmallCaps" Background="{StaticResource WindowMainBrush}" DockPanel.Dock="Bottom">
                    <TextBlock TextAlignment="Right" Margin="12,6,12,6" Foreground="{StaticResource WindowMainTextBrush}" Text="{Binding CurrentState, Converter={StaticResource gameStateToStringConverter}}" />
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="340" MinWidth="340" />
                        <ColumnDefinition Width="4" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <DockPanel>
                        <TextBlock DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="24">
					        <TextBlock Text="Time Left: " />
                            <TextBlock Text="{Binding Path=SecondsLeft}" />
                            <TextBlock Text="s    Score: " />
                            <TextBlock Text="{Binding Path=Score}" />
				        </TextBlock>
                        <DockPanel DockPanel.Dock="Bottom" Margin="8">
                            <Button Name="btnSubmit" DockPanel.Dock="Right" Content="_Submit" Command="b:BoggleCommands.SubmitWordCommand" />
                            <TextBox Name="txtWord" FontSize="16" Padding="4" Margin="4" Text="{Binding CurrentWord, UpdateSourceTrigger=PropertyChanged}" />
                        </DockPanel>
                        <ContentControl Content="{Binding Grid}" />
                    </DockPanel>
                    <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
                    <Grid Grid.Column="2">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="2*" />
                            <RowDefinition Height="4" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <ListBox Name="lstWords" ItemsSource="{Binding Words}" SelectedItem="{Binding SelectedWord}">
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ListBoxItem}">
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                </Style>
                            </ListBox.ItemContainerStyle>
                        </ListBox>
                        <GridSplitter HorizontalAlignment="Stretch" Grid.Row="1" />
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Grid.Row="2">
                            <TextBlock Margin="4" DataContext="{Binding SelectedWord}" Text="{Binding Mode=OneWay, Path=Definition}" />
                        </ScrollViewer>
                    </Grid>
                </Grid>
            </DockPanel>
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="top" Grid.Column="1"/>
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="bottom" Grid.Row="2" Grid.Column="1" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="left" Grid.Row="1" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="right" Grid.Row="1" Grid.Column="2" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="bottomLeft" Grid.Row="2" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="bottomRight" Grid.Row="2" Grid.Column="2" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="topRight" Grid.Column="2" />
            <ContentControl Style="{StaticResource BorderStyle}" x:Name="topLeft" />
        </Grid>
    </Border>
</Window>
